<html>
<head><meta charset="utf-8"><title>liveness-drops-vs-regular-uses · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html">liveness-drops-vs-regular-uses</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="128844194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844194">(Jun 29 2018 at 18:54)</a>:</h4>
<p>ok <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> was asking me some questions about liveness and I'm moving it here</p>



<a name="128844195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844195">(Jun 29 2018 at 18:54)</a>:</h4>
<p>so we compute currently two sets of liveness bits</p>



<a name="128844197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844197">(Jun 29 2018 at 18:54)</a>:</h4>
<p>there is definitely <em>some</em> overlap here</p>



<a name="128844205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844205">(Jun 29 2018 at 18:54)</a>:</h4>
<p>the first set is "regular use live" — this implies that a variable will be used later on in a "regular" way. e.g., <code>foo(x)</code> makes <code>x</code> live for stuff that came before it</p>



<a name="128844222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844222">(Jun 29 2018 at 18:55)</a>:</h4>
<p>the second set is "drop live" — this implies that a variable will be <em>dropped</em> later on ... these are implicit actions generated by the compiler. So e.g. with <code>{ let x = vec![...]; ... }</code> the <code>x</code> will be "drop live" during the <code>...</code> because at the end of the block we are going to drop it</p>



<a name="128844228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844228">(Jun 29 2018 at 18:55)</a>:</h4>
<p>(note that <code>mem::drop(x)</code> is just a regular function call, despite its name)</p>



<a name="128844241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844241">(Jun 29 2018 at 18:55)</a>:</h4>
<p>there is overlap between these two sets because most things that will be used later may also be dropped — but not <em>all</em> things</p>



<a name="128844245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844245">(Jun 29 2018 at 18:56)</a>:</h4>
<p>notably integers or things that do not implement <code>Drop</code></p>



<a name="128844283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844283">(Jun 29 2018 at 18:56)</a>:</h4>
<p>will not have a <code>Drop</code> opcode</p>



<a name="128844293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844293">(Jun 29 2018 at 18:56)</a>:</h4>
<p>so actually they are just kind of two distinct, but sometimes overlapping, sets</p>



<a name="128844314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844314">(Jun 29 2018 at 18:56)</a>:</h4>
<p>yeah makes sense</p>



<a name="128844328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844328">(Jun 29 2018 at 18:57)</a>:</h4>
<p>I think I was confused because you mentioned one thing being a subset of the other one</p>



<a name="128844331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844331">(Jun 29 2018 at 18:57)</a>:</h4>
<p>btw <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> you mentioned sparse sets</p>



<a name="128844335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844335">(Jun 29 2018 at 18:57)</a>:</h4>
<p>I may have read it wrong :)</p>



<a name="128844336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844336">(Jun 29 2018 at 18:57)</a>:</h4>
<p>using them may well make sense</p>



<a name="128844341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844341">(Jun 29 2018 at 18:57)</a>:</h4>
<blockquote>
<p>I may have read it wrong :)</p>
</blockquote>
<p>no, I did say that, but I was mistaken</p>



<a name="128844344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844344">(Jun 29 2018 at 18:57)</a>:</h4>
<p>ok</p>



<a name="128844348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844348">(Jun 29 2018 at 18:57)</a>:</h4>
<p>the other optoin — instead of sparse sets — is to go "all in" with dense sets</p>



<a name="128844349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844349">(Jun 29 2018 at 18:57)</a>:</h4>
<p>this is what the other dataflow does</p>



<a name="128844350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844350">(Jun 29 2018 at 18:57)</a>:</h4>
<p>yeah, your explanation matches my understanding then :)</p>



<a name="128844355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844355">(Jun 29 2018 at 18:57)</a>:</h4>
<p>e.g. if you have N variables and M blocks</p>



<a name="128844361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844361">(Jun 29 2018 at 18:57)</a>:</h4>
<p>we currently allocate M dense sets of N bits each</p>



<a name="128844366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844366">(Jun 29 2018 at 18:58)</a>:</h4>
<p>we <em>could</em> allocate 1 dense set of M*N bits</p>



<a name="128844406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844406">(Jun 29 2018 at 18:58)</a>:</h4>
<p>and then just operate on subsets of that</p>



<a name="128844407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844407">(Jun 29 2018 at 18:58)</a>:</h4>
<p>this is what the main dataflow does, for locality or whatever else</p>



<a name="128844409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844409">(Jun 29 2018 at 18:58)</a>:</h4>
<p>it is unclear which is better :)</p>



<a name="128844411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844411">(Jun 29 2018 at 18:58)</a>:</h4>
<p>sparse sets may well be better</p>



<a name="128844419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844419">(Jun 29 2018 at 18:58)</a>:</h4>
<p>if you do that it could make sense to merge drops and uses</p>



<a name="128844428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844428">(Jun 29 2018 at 18:58)</a>:</h4>
<p>I was hoping off on suggesting much experimentation here because it's not <em>that</em> big a percentage of our overall time</p>



<a name="128844431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844431">(Jun 29 2018 at 18:58)</a>:</h4>
<p>I mean, you need more than one bit</p>



<a name="128844435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844435">(Jun 29 2018 at 18:58)</a>:</h4>
<p>but it's easy enough to experiment with a sparse set really</p>



<a name="128844444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844444">(Jun 29 2018 at 18:58)</a>:</h4>
<p>we have the code after all (hey, you wrote it=)</p>



<a name="128844457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844457">(Jun 29 2018 at 18:59)</a>:</h4>
<p>yes, I've copied it but yeah :P</p>



<a name="128844467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844467">(Jun 29 2018 at 18:59)</a>:</h4>
<p>:)</p>



<a name="128844472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844472">(Jun 29 2018 at 18:59)</a>:</h4>
<blockquote>
<p>if you do that it could make sense to merge drops and uses</p>
</blockquote>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> does this makes sense?</p>



<a name="128844531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844531">(Jun 29 2018 at 19:00)</a>:</h4>
<p>uh</p>



<a name="128844532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844532">(Jun 29 2018 at 19:00)</a>:</h4>
<p>I mean in the dense case and using more than one bit</p>



<a name="128844546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844546">(Jun 29 2018 at 19:00)</a>:</h4>
<p>i.e., really we would be allocating 2 sets of M*N</p>



<a name="128844556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844556">(Jun 29 2018 at 19:00)</a>:</h4>
<p>but it could be 1 of 2 x M x N instead?</p>



<a name="128844566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844566">(Jun 29 2018 at 19:00)</a>:</h4>
<p>well I guess it uses less memory :)</p>



<a name="128844577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844577">(Jun 29 2018 at 19:00)</a>:</h4>
<p>yeah, that could make sense, idk</p>



<a name="128844588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844588">(Jun 29 2018 at 19:01)</a>:</h4>
<p>it may not make that much difference</p>



<a name="128844593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844593">(Jun 29 2018 at 19:01)</a>:</h4>
<p>to do 2 big alloc vs 1 big one :)</p>



<a name="128844607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844607">(Jun 29 2018 at 19:01)</a>:</h4>
<p>it's not entirely clear that doing less alloc is really a win here anyway, would have to measure</p>



<a name="128844678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844678">(Jun 29 2018 at 19:02)</a>:</h4>
<p>yeah, but how much of those big allocs are done?</p>



<a name="128844679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844679">(Jun 29 2018 at 19:02)</a>:</h4>
<p>isn't one per fn?</p>



<a name="128844698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844698">(Jun 29 2018 at 19:03)</a>:</h4>
<blockquote>
<p>it's not entirely clear that doing less alloc is really a win here anyway, would have to measure</p>
</blockquote>
<p>anyway, agree, it should always be measured</p>



<a name="128844712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844712">(Jun 29 2018 at 19:03)</a>:</h4>
<p>anyway, if it's 2% of the thing it may not worth spending a lot of time now</p>



<a name="128844769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844769">(Jun 29 2018 at 19:04)</a>:</h4>
<p>cool</p>



<a name="128844805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses/near/128844805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/liveness-drops-vs-regular-uses.html#128844805">(Jun 29 2018 at 19:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> so I'm gonna focus on <a href="https://github.com/rust-lang/rust/issues/51818" target="_blank" title="https://github.com/rust-lang/rust/issues/51818">https://github.com/rust-lang/rust/issues/51818</a>, then will ping you to see if worth to do the sparse bit set stuff and the rest I guess can wait</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>